import instance from "@/axios";

//获取获取登陆用户的商品列表
export const getCommodityList = (data) => {
  return instance.post("/applet/commodity/getLoginUserCommodityList", data);
};

//获取登陆用户的商品列表-根据分组获取商品列表
export const getLoginUserGroupCommodityList = (data) => {
  return instance.post(
    "/applet/commodity/getLoginUserGroupCommodityList",
    data
  );
};

// 下架商品
export const downCommodity = (data) => {
  return instance.post("/applet/commodity/appCommodityDown", data);
};

// 解绑商品
export const ShopCommodityCustomizeGroupUnbindCommodity = (data) => {
  return instance.post("/applet/commodityGroup/ShopCommodityCustomizeGroupUnbindCommodity", data);
};

// 获取商品类别
export const getCommodityClassification = (id) => {
  return instance.post(
    `/biz/commodityClassification/getCommodityClassification/${id}`
  );
};

// 获取商品分组
export const getCommodityGroup = (data) => {
  return instance.post(
    `/applet/commodityGroup/showShopCommodityCustomizeGroup`,
    data
  );
};

// 获取商品详情
export const getCommodityById = (data) => {
  return instance.post(`/applet/commodity/getCommodityNotStatusById`, data);
};

// 新增商品
export const addCommodity = (data) => {
  return instance.post(`applet/commodity/addCommodity`, data);
};

// 修改商品
export const updateCommodity = (data) => {
  return instance.post(`applet/commodity/updateCommodity`, data);
};

// 删除商品
export const deleteCommodity = (data) => {
  return instance.post(`applet/commodity/deleteCommodity`, data);
};
